#include "NetworkTest.h"

#include "Network.h"
#include "World.h"

#include "Player.h"

#include <iostream>

void NetworkTestLoop()
{
	//A Mock Game Loop
	bool loop = true;

	//Create and set this up as a client/server
	Network::Create();

	std::cout << "RSFPSA Network Testing\n\nType 's' to run as server\nType 'c' to run as client\nDon't type anything else or I'll break\n\n:>";
	char in;
	std::cin >> in;

	if(in == 's')
	{
		Network::Get()->Initalise(true);
	} else if(in == 'c') {
		Network::Get()->Initalise(false);
		Network::Get()->ConnectTo("127.0.0.1", 50100);
	}

	//Set up the network, get the game running
	World::Create();

	while(loop)
	{
		Network::Get()->PreUpdate();
		

		Network::Get()->PostUpdate();
	}
}